<template>
  <div v-loading="mainLoading">
    <el-col :xs="24" :sm="24" :md="4" :lg="4" :xl="5" class="height100">
      <Left @toggleMainLoading="toggleMainLoading"></Left>
    </el-col>
    <el-col :xs="24" :sm="24" :md="20" :lg="20" :xl="19">
      <el-row>
        <Header @toggleMainLoading="toggleMainLoading" ref="Header"></Header>
      </el-row>
      <el-row style="padding: 10px;margin-bottom: 40px;">
        <transition name="slide-fade">
          <router-view class="center-content" @refreshSessionStorge="refreshSessionStorge"/>
        </transition>
      </el-row>
      <div style="position:fixed; bottom:0;width: 100%">
        <footer>
          <div style="position:relative;top: 35%;height: 50%;left: -10%">
            © 2011 - 2017 15951963820@163.com | v3sking 版权所有
          </div>
        </footer>
      </div>
    </el-col>
  </div>
</template>

<script>
  import Header from '../components/Header'
  import Left from '../components/Left'

  export default {
    name: "Main",
    components: {Header, Left},
    data() {
      return {
        mainLoading: false,
      }
    },
    methods: {
      toggleMainLoading() {
        this.mainLoading = !this.mainLoading
      },
      refreshSessionStorge() {
        this.$refs.Header.loadUser()
      }
    }
  }
</script>

<style scoped>
  .center-content {
    padding: 12px;
    height: 100%;

  }

  .el-aside, .el-main {
    overflow: visible;
  }

  .el-header, .center-content {
    padding: 0;
  }

  footer {
    color: #2c3e50;
    font-size: 10px;
    line-height: 10px;
    text-align: center;
    width: 100%;
    height: 40px;
    background-color: #ECF0F1;
  }

  .slide-fade {
    position: absolute;
    left: 0;
    right: 0;
  }

  .slide-fade-enter-active {
    transition: all .4s ease;
  }

  .slide-fade-leave-active {

    transition: all .1s cubic-bezier(2.0, 0.5, 0.8, 1.0);
  }

  .slide-fade-enter, .slide-fade-leave-to {
    left: 0;
    right: 0;
    transform: translateY(10px);
    opacity: 0;
  }
</style>
